﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
using System.Windows.Media.Imaging;

namespace WriteableBitmap
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            WebBrowserTask webBrowserTask = new WebBrowserTask();
            webBrowserTask.Uri = new Uri("http://techappy.net/", UriKind.Absolute);
            webBrowserTask.Show();
        }

        private void miChanged_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
        {
            Storyboard story = this.Resources["Storyboard1"] as Storyboard;
            story.Completed += (obj, arg) => 
            {
                this.miChanged.Source = new BitmapImage(new Uri("Images/appbar.sync.rest.png", UriKind.Relative));
                slider.Value = 0;
            };
            this.miChanged.Source = new BitmapImage(new Uri("Images/appbar.stop.rest.png", UriKind.Relative));
            story.Begin();
        }

        private void miChanged_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {

        }
    }
}